import { WebGLCanvas } from "@nirvana/canvas";
import { AmbientLight, Camera, SceneNode } from "@nirvana/core";

async function main() {
  let canvas = document.getElementById("engine-nirvana");
  const webCanvas = new WebGLCanvas(canvas, {
    rate: 1
  });
  const engine = webCanvas.engine;

  const scene = engine.sceneManager.createScene("root");
  const camera = new Camera("", engine);
  scene.addCamera(camera);
  camera.transform.setPosition(0, 0, 20);
  const rootEntity = new SceneNode("root-entity");
  scene.addEntity(rootEntity);

  const ambLight = new AmbientLight("alight");
  ambLight.color.set(0.1, 0.1, 0.1, 1);
  scene.addLight(ambLight);

  engine.update = () => {};
}

main();
